import 'package:flutter/material.dart';

import '../../../../widgets/common_image.dart';
import '../../../../model/classification.dart';

class ClassificationWidget extends StatelessWidget {
  final Classification data;
  const ClassificationWidget(
    this.data, {
    Key? key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    var width = MediaQuery.of(context).size.width * 0.33 - 25;

    return GestureDetector(
        onTap: () {},
        child: Container(
          width: width,
          height: 140,
          padding: EdgeInsets.only(top: 20.0, bottom: 18.0),
          decoration: BoxDecoration(color: Colors.grey.shade200),
          child: Column(
            children: [
              Container(
                  width: 60, height: 60, child: CommonImage(data.classImgUrl!)),
              Text(data.title!),
              Text("${data.bookNum!}本书",
                  style: TextStyle(
                    color: Colors.grey.shade500,
                    fontSize: 12.0
                  )),
            ],
          ),
        ));
  }
}
